import * as storageKeys from "./key";
/**清除所有storage */
export const clear = (excludes: string[] = []) => {
  for (const index in storageKeys) {
    const key = storageKeys[index];
    if (excludes.includes(key)) continue;
    localStorage.removeItem(key);
  }
};

/**退出登录清除storage */
export const clearLoginInfo = () => {
  clear([
    storageKeys.THEME_CONFIG,
    storageKeys.REMEMBER_ME,
    storageKeys.USER_NAME,
    storageKeys.PASSWORD,
  ]);
};
